package com.dll.pybig.controller;

import com.dll.pybig.service.StuCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CommentController {
    @Autowired
    StuCommentService stuCommentService;
    @PostMapping(value = {"/comments/shows/{pages}", "/comments/shows"})
    public Object getIpage(@RequestParam("stuName") String stuName, @PathVariable(required = false) Integer pages) {
        if (pages == null) {
            pages = 1;
        }
        return stuCommentService.searchInfo(stuName, pages);
    }
}
